import request from "@/util/request";

export const memberCardCreate = (data) => request({
  url: '/enjooo-api/order/card/create',
  method: 'post',
  data
});

export const memberCardReceived = (cardNo) => request({
  url: '/enjooo-api/order/card/received',
  method: 'post',
  params: {
  	cardNo
  }
});

/**
 * 核验会员卡订单
 * @param {Object} orderId
 * @param {Object} storeId
 */
export const memberCardOrderVerify = (orderId,storeId) => request({
  url: '/enjooo-api/order/card/verify',
  method: 'post',
  params: {
  	orderId,storeId
  }
});

/**
 * 会员卡订单详情
 * @param {Object} orderId
 */
export const memberCardOrderDetail = (orderId) => request({
  url: '/enjooo-api/order/card/order',
  params: {
	  orderId
  }
});

/**
 * 加入购物车
 * @param {Object} data
 */
export const addCart = (data) => request({
  url: '/enjooo-api/order/createCart',
  method: 'post',
  data
});

/**
 * 获取会员当前购物车
 */
export const memberCart = () => request({
  url: '/enjooo-api/order/memberCart'
});

/**
 * 确认订单
 */
export const orderCreate = (data) => request({
  url: '/enjooo-api/order/createOrder',
  method: 'post',
  data
});

/**
 * 核验订单
 */
export const verifyOrder = (orderId,storeId) => request({
  url: '/enjooo-api/order/verify',
  method: 'post',
  params: {
  	orderId,storeId
  }
});

export const orderDetail = (orderId) => request({
  url: '/enjooo-api/order/detail',
  params: {
	  orderId
  }
});

/**
 * 获取当前门票订单
 */
export const currentTicketOrder = () => request({
  url: '/enjooo-api/order/currentTicketOrder'
});